package base.网络编程.UDP;

import java.io.IOException;
import java.net.*;

public class 发 {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket();//空参：随机端口发送

        String str = "你好世界！！";
        byte[] bytes = str.getBytes();
        InetAddress ip = InetAddress.getByName("255.255.255.255");
        DatagramPacket dp = new DatagramPacket(bytes,bytes.length,ip,10086);

        ds.send(dp);

    }
}
